home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-09 | 793 b | 32 lines | [TEXT/MEDT] |
- MODULE InlineDemo; (* H. Seiler, 15-Mar-87 *)
-
- FROM SYSTEM IMPORT ADDRESS, INLINE, REG, SETREG;
-
- PROCEDURE InlineDemo1(p, q: LONGINT) : LONGINT;
- (* demonstrates the access to parameters and the function result *)
- (* without explicit knowlegde of the offsets produced by the compiler. *)
- CONST D0 = 0; D1 = 1;
- BEGIN
- SETREG(D0, p);
- SETREG(D1, q);
- INLINE(4680H, 4681H, 8081H);
- RETURN REG(D0)
- END InlineDemo1;
-
-
- PROCEDURE InlineDemo2(p, q: ADDRESS) : LONGINT;
- (* copy the bytes from p^ to q^ until a zero-byte is *)
- (* found and return the number of bytes copied. *)
- CONST D0 = 0; A0 = 8; A1 = 9;
- BEGIN
- SETREG(A0, p);
- SETREG(A1, q);
- SETREG(D0, REG(A0));
- INLINE(12D8H, 66FCH);
- RETURN REG(A0) - REG(D0)
- END InlineDemo2;
-
- END InlineDemo.
-
-
-